/*
 * @Author: mikey.zhaopeng
 * @Date:   2016-02-18 17:25:45
 * @Last Modified by:   mikey.zhaopeng
 * @Last Modified time: 2016-03-10 15:40:27
 */

'use strict';
define([
    './baseBean',
], function(
    BaseBean
) {
    function me() {
        BaseBean.apply(this, arguments);
        var self = this;
        this.searchAppsAndConfigurations = function(callback, errorCallback) {
            var params = {};
            if (self.fmpsearchAppsAndConfigurations) {
                if (callback) {
                    var result = self.fmpsearchAppsAndConfigurations;
                    callback(result, params);
                }
                return;
            }
            self.p('/connectionobjects/searchAppsAndConfigurations', params, function(result) {
                self.fmpsearchAppsAndConfigurations = result;
                if (callback) {
                    callback(result, params);
                }
            }, errorCallback);
        }

        /**
         * { 清空缓存 }
         *
         * @method     reset
         */
        this.reset = function() {
            delete self.fmpsearchAppsAndConfigurations;
        }
    };
    return new me();
});
